<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
    <![endif]-->
    <title></title>
</head>
<body>
<div class="contant">
<div class="row">
        <div class="top">业务部>快递录入</div>
        <div class="content addapply">
        <form action="{:U('Express/add_info')}" method="post" id='add_express'>
            <div class="box" style='width: 56%'>
                <h1>快递录入<span>(标*为必填项)</span></h1>
                <div class="list-block">
                    <div class="row">
                        <label>寄件人:<i class="required">*</i></label>
                        <input type="text" name="send_name" value=''>
                        <label>收件人:<i class="required">*</i></label>
                        <input type="text" name="addressee" value=''>
                    </div>
                    <div class="row">
                        <label>快递单号:<i class="required">*</i></label>
                        <input type="text" name="express_number" value=''>
                        <label>客户姓名:</label>
                        <input type="text" name="user_name" value='{$user.user_name}' readonly>
                    </div>
                    <div class="row">
                        <label>快递内容:</label>
                        <div class="row">

                        <input type="checkbox" onclick="swapCheck()" /><span for="file1" style="color: red">全选/取消</span>
                        <input type='checkbox' class="form-control" id='file1' name='file[]' value='1' ><span for="file1">借款合同</span>
                        <input type='checkbox' class="form-control" id='file2' name='file[]' value='2' ><span for="file2">抵押合同</span>
                        <input type='checkbox' class="form-control" id='file3' name='file[]' value='3' ><span for="file3">驾照复印件</span>
                        </div>
                        <div class="row">
                        <input type='checkbox' id='file4' name='file[]' value='4' ><span for="file4">身份证复印件</span>
                        <input type='checkbox' id='file5' name='file[]' value='5' ><span for="file5">银行流水</span>
                        <input type='checkbox' id='file6' name='file[]' value='6' ><span for="file6">户口本</span>
                        <input type='checkbox' id='file7' name='file[]' value='7' ><span for="file7">结婚证/单身具结书</span>
                        </div>
                        <div class="row">
                        <input type='checkbox' id='file8' name='file[]' value='8' ><span for="file8">卡单</span>
                        <input type='checkbox' id='file9' name='file[]' value='9' ><span for="file9">收入证明</span>
                        <input type='checkbox' id='file10' name='file[]' value='10' ><span for="file10">房产证</span>
                        <input type='checkbox' id='file11' name='file[]' value='11' ><span for="file11">发票</span>
                        </div>
                        <div class="row">
                        <input type='checkbox' id='file12' name='file[]' value='12' ><span for="file12">合格证</span>
                        <input type='checkbox' id='file13' name='file[]' value='13' ><span for="file13">保单</span>
                        <input type='checkbox' id='file14' name='file[]' value='14' ><span for="file14">合同书</span>
                        </div>
                        <!-- <input type='checkbox' id='file15' name='file[]' value='15' ><span for="file15">二手车还需提供行驶证</span>  -->
                    </div>
                    <div class="row">
                        <label>快递时间:</label>
                        <input type="text" id="express_times" name="express_times" value="{:date('Y-m-d')}" class="datepicker" readonly />
                        <!-- <input type="text" name="express_time"> -->
                        <label>快递公司:</label>
                        <select name="company_id" id="form-field-10">
                            <foreach name="express_company" item="v" >
                             <if condition="$key eq $info['company_id']">
                            <option value={$key} selected>{$v}</option>
                             <else />
                             <option value={$key}>{$v}</option>
                            </if>
                            </foreach>
                        </select>
                    </div>
                    <div class="row">
                        <label>上传照片: <i class="required">*</i></label>
                        <label class="inputfile"><img id='fristImg' class="pic" name='fristImg' src="__PUBLIC__/Common/images/default_upload.png" >
                        <input type='hidden' id='one' name='img' value=''/>
                        <input type="file" id="fileId1"  name="file[]" class="uploadA"><i>上传图片</i></label>

                    </div>

                    <div class="box">
                        <div class="list-block">
                            <input type="button" class="button01" id='tijiao' value="提交" name="">
                            <input type="hidden"  value="{$user.id}" name="user_id">
                            <input type="button" class="button01" value="暂不提交" name="" onclick="location.href='/Admin/Express/add_index'">
                        </div>
                    </div>
                </div>
            </div>
            </form>
        </div>
    </div>
</div>
    <style type="text/css">
        i{cursor: pointer;}
        .pic{
            width:138px;
            height:118px;
            border-radius:0% ;
            cursor: pointer;
            background: #fff;
            /*position: absolute;
            */z-index: 1;
        }
    </style>

    <script type="text/javascript" src='{:COM}js/daterangepicker.min.js'></script>
    <script src="{:COM}js/ajaxfileupload.js"></script>
    <script type="text/javascript">
        <volist name="info.file" id="file">
            $('#file{$file}').attr('checked', true);
            $('#file{$file}').attr('disabled', true);
        </volist>
    </script>

    <script type="text/javascript">
    $('input.datepicker').datetimepicker({format : "yyyy-mm-dd", minView : 2, autoclose : true});
    $('#tijiao').click(function(){
         if ($("input[name='send_name']").val()=='') {
               return false;
            }else if ($("input[name='addressee']").val()=='') {
               return false;
            }else if ($("input[name='express_number']").val()=='') {
               return false;
            }else if ($("input[name='img']").val()=='') {
                alert('请上传照片');
               return false;
            }
         $('#add_express').submit();
    });
    $('.uploadA').change(function(){
            $.ajaxFileUpload({
                url:'{:U("Upload/logo")}',//处理图片脚本
                secureuri: false,
                fileElementId :'fileId1',//file控件id
                dataType : 'text',
                success: function (data){
                    $("#fristImg").attr("src",data);
                    $("#one").attr("value",data);
                },
                error: function(data){
                    alert(data+"333");
                }
            })
        })

        var isCheckAll = false;
        function swapCheck() {
            if (isCheckAll) {
                $("input[type='checkbox']").each(function() {
                    this.checked = false;
                });
                isCheckAll = false;
            } else {
                $("input[type='checkbox']").each(function() {
                    this.checked = true;
                });
                isCheckAll = true;
            }
        }
    </script>
</body>
</html>
